package edu.ntu.im.p2ptrade.entity;

import java.io.Serializable;

public class Item implements Serializable{
	private Integer id;

	private String ownerId;

	private String name;

	private String memo;

	private String photoUrl;
	
	static final long serialVersionUID = 649912149791811557L;

	public Item(String ownerId, String name) {
		this.name = name;
		this.ownerId = ownerId;
	}

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public String getMemo() {
		return memo;
	}

	public void setMemo(String memo) {
		this.memo = memo;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getOwnerId() {
		return ownerId;
	}

	@Override
	public boolean equals(Object obj) {
		if (!(obj instanceof Item)) {
			return false;
		}
		Item other = (Item) obj;
		return other.id == this.id;
	}

	@Override
	public int hashCode() {
		return id.hashCode();
	}

	public void setOwnerId(String ownerId) {
		this.ownerId = ownerId;
	}

	public String getPhotoUrl() {
		return photoUrl;
	}

	public void setPhotoUrl(String photoUrl) {
		this.photoUrl = photoUrl;
	}

	@Override
	public String toString() {
		return "{ id:"+this.id+", name:"+this.name+", memo:"+this.memo+", photoUrl:"+this.photoUrl+"}";
	}

}
